package com.mor.shiro.test.tree;

class TreeNode {
    int val;
    TreeNode left;
    TreeNode right;

    TreeNode(int x) {
        val = x;
    }
}
public class Solution {
    public boolean isBalanced(TreeNode root) {
        return true;
    }
    public static void before(TreeNode root){
        if(null!=root){
            System.out.println(root.val);
        }else if(root.left!=null){
                before(root.left);
        }else if(root.right!=null){
                before(root.right);
        }
    }

    public static void main(String[] args) {
        TreeNode t1=new TreeNode(1);
        TreeNode t2=new TreeNode(2);
        TreeNode t3=new TreeNode(3);
        TreeNode t4=new TreeNode(4);
        TreeNode t5=new TreeNode(5);
        TreeNode t6=new TreeNode(6);
        TreeNode t7=new TreeNode(7);
        TreeNode t8=new TreeNode(8);

        t1.left=t2;t1.right=t3;
        t2.left=t4;t2.right=t5;
        t3.right=t6;

        before(t1);
    }
}